package com.neu.service.impl;

import com.neu.dao.UserDao;
import com.neu.po.User;
import com.neu.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class LoginServiceImpl implements LoginService {
	@Autowired
	private UserDao dao;
	public void setDao(UserDao dao){
		this.dao = dao;
	}
	
	public User login(String name,String pwd) {
		return dao.selectOne(name,pwd);
	}

	@Override
	public void add(String name,String loginName,String loginPwd,float balance,String phone) {
		User user=new User(name,loginName,loginPwd,phone,balance);
		dao.insert(user);
	}
}
